import React, { useState } from 'react'


// 需求：创建出来的 ref 不能和函数组件进行关联
export default function App () {
  const [count, setCount] = useState(10)
  const handleClick = () => {
    setInterval(() => {
      setCount((count) => count - 1)
    }, 1000)
  }
  return (
    <div>
      <h3>{count}</h3>
      <button onClick={handleClick}>开启定时器</button>
    </div>
  )
}